package com.nth.rooster.notifications.controllers;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.nth.rooster.core.exception.NErrorCode;
import com.nth.rooster.notifications.beans.NotificationBean;
import com.nth.rooster.notifications.exceptions.NotificationExcetption;

/**
 * Hello world!
 * 
 */
@Controller
@RequestMapping("/Notification")
public class Notification {

	static Logger LOGGER = Logger.getLogger(NotificationBean.class);

	@RequestMapping(value = "/getNotifications", method = RequestMethod.GET)
	@ResponseBody
	public List<NotificationBean> getNotificationsForUser(
			@RequestParam Long userID) {
		LOGGER.info("Entered::Notification::getEventsForUser::userID" + userID);
		if (userID.compareTo(0l) < 0) {
			//throw new NotificationExcetption(NErrorCode.INVALID_LOGIN_AUTHENTICATION, userID);
		}
		List<NotificationBean> notifications = null;
		LOGGER.info("Exited::Notification::getEventsForUser::userID" + userID);
		return notifications;
	}

	@RequestMapping(value = "/createNotification", method = RequestMethod.POST)
	@ResponseBody
	public Long createNotification(
			@RequestBody NotificationBean notificationBean,
			@RequestParam Long userID) {
		LOGGER.debug("Entered::Notification::Notification::createNotification");
		Long notificationID = null;
		LOGGER.debug("Exited::Notification::Notification::createNotification");
		return notificationID;
	}

}
